package com.cl.edu.dao;

import java.util.List;

import org.springframework.stereotype.Repository;


import com.cl.core.orm.hibernate.HibernateDao;
import com.cl.edu.entity.Area;


@Repository
public class AreaDAO extends HibernateDao<Area,String>{
	/**
	 * 查询中国所有省级行政区划
	 * @return
	 */
	public List<Area> getSheng() {
		StringBuffer hql = new StringBuffer("from Area model ");
		hql.append(" where model.id like '__0000'");
		return this.find(hql.toString());
	}
	
	/**
	 * 查询沈阳市下级行政区划
	 * @return
	 */
	public List<Area> getShenYang() {
		StringBuffer hql = new StringBuffer("from Area model ");
		hql.append(" where model.id like '2101__' and model.id != '210100'");
		return this.find(hql.toString());
	}
}
